{extend name="blog/index"}
{block name="main"}
   

<link rel="stylesheet" href="/static/css/blog_index/cmt.css" type="text/css"  />
<script type="text/javascript">
$('a.submenuComment').addClass('actived');
$(document).ready(function(){
		
	$(".cmtListSys .cmtItem:last").css("background-image","none");
	
	$(".cmtListSys h5").click(function(){
		$(this).next(".cmt_main_content").toggle("fast");
		$(this).find(".cmt_fold").toggle();
		$(this).find(".cmt_unfold").toggle();
	});
});
function cmtReply(id) {
    $("#submitReply"+id).disabled = false;
	$("#cmt_reform_"+id).toggle("fast");
	$("#cmt"+id+"_re").hide("fast");
	$("#cmt_rebutton_"+id).toggle("fast");
	return false ;
}
function cmtReplayCancel(id, type) {
        $("#cmt_reform_"+id).toggle("fast");
        if(type == 1){
                $("#cmt"+id+"_re").show("fast");
        }
        
        $("#cmt_rebutton_"+id).toggle("fast");
	return false ;
}
function status_multi() {
    if (!confirm('确实要显示这些评论吗？')) {
        return;
    }
    var id = [];
    $('.cmtList :checkbox:checked').each(function(k,v){
        id.push($(v).val())
    });
    saveStatus(null, id, 1);
}
function saveStatus(obj, ids, s) {
	data = new Object();
	data.cmid = ids.toString();
	data.status = s;
	data.REQUEST_METHOD = "PUT";
	$.ajax({
		beforeSend:function(xhr){
			xhr.setRequestHeader('Accept', 'text/json');
		},
		url: "/7234306/comments/status",
		type:"post",           
		dataType:"json",
		data: data,
		success:function(xml) {
			//alert(xml.success.data);
			if(obj == null) {
				window.location.reload();
			}
			if(s == 1) {
				$(obj).toggle();
				$(obj).next('.anti').toggle();
				$(obj).nextAll('.rep').toggle();
				$(obj).parents('.cmtItem').removeClass('cmt_antied');
			}
			else {
				$(obj).toggle();
				$(obj).next('.rep').toggle();
				$(obj).prev('.pass').toggle();
				$(obj).parents('.cmtItem').addClass('cmt_antied');
			}
			return false;
		}
	});
	
	return false;
}
function del_multi() {
    if (!confirm('确实要删除这些评论吗？')) {
        return;
    }
    var id = [];
    $('.cmtList :checkbox:checked').each(function(k,v){
        id.push($(v).val())
    });
    del_cm(null, id);
}
function del_cm(obj, ids) {
	data = new Object();
	data.cmid = ids.toString();
	data.REQUEST_METHOD = "DELETE";
	$.ajax({
		beforeSend:function(xhr){
			xhr.setRequestHeader('Accept', 'text/json');
		},
		url: "/7234306/comments/item",
		type:"post",           
		dataType:"json",
		data: data,
		success:function(xml) {
			if(obj == null) {
				window.location.reload();
			}
			$("#"+obj).hide('slow',function(){$(this).remove();}); 
			return false;
		}
	});
	
	return false;
}
function saveReply(obj, id) {
    var submitButton = "submitReply"+id;
    document.getElementById(submitButton).disabled = true;
    var infoObj = "reply_info_"+id;
    data = new Object();
    data.rid = obj.rid.value;
    data.blogid = obj.blogid.value;
    data.content = obj.reply.value;
    data.cmid = obj.cmid.value;
	$.ajax({
		beforeSend:function(xhr){
			xhr.setRequestHeader('Accept', 'text/json');
		},
		url: "/7234306/comments/reply",
		type:"post",           
		dataType:"json",
		data: data,
		success:function(xml) {
            var item = xml.success.data;
            document.getElementById(infoObj).innerHTML=item.today+" 回复 : "+obj.reply.value;
            obj.rid.value = item.rid;
            $("#replylink_"+id).html("[修改回复]");
            $("#cmt_reform_"+id).toggle('fast');
            $("#cmt"+id+"_re").show('fast');
            return false;
		}
	});
	return false;
}
</script>
<style type="text/css">
.nav ul li.pinlun a { 
  background:#fff; 
  color:#90c044; 
  -webkit-border-radius:5px 5px 0 0; 
  -moz-border-radius:5px 5px 0 0; 
  border-radius:5px 5px 0 0; 
}
</style>
<div class="container">
	<div class="content">
	     <div class="current-blog">
	      <span class="subCurrent">
	<div style='float:left'>
	当前博客：<a title="在新窗口中查看：蒂法 (http://queentifa.blogbus.com" class="pub_blogName01" target="_blank" href="http://queentifa.blogbus.com">蒂法</a>
	</div>
	<div style='float:left;margin-left:10px'>
		<a id="switch_blog" onclick="toggleMenu('#dm_changeBlog')" title="切换当前博客" class="pub_subLink" href="javascript:void(0)">[切换博客]</a>
		<ul style="display: none;" class="pub_dropmenu change_blog" id="dm_changeBlog">
			
			<li><a onclick="hideMenu('#dm_changeBlog');return false;" href="/7234306/comments/items">
				蒂法</a></li>
			
		</ul>
	</div>
	<script type="text/javascript">
	function toggleMenu(selector){
		$(selector).slideToggle('fast');
	}
	</script>
</span>
</h2>
	      </div>
		<div class="blog-submenus">
				<strong>全部评论</strong> | <a href="?hidden">已隐藏</a>
				</div>
    <div id="pub_main" class="pub_topline">
        <ul class="cmtList">
                        <form method="post" action="/status" name="changeStatus" style="display:none;"><input name="REQUEST_METHOD" value="DETETE" type="hidden" /><input type="hidden" name="id"/><input type="hidden" name="status"/></form>        </ul>
        <div class="pub_listFoot">
            <div style="margin-top:10px;">
            	 	<input  type="checkbox" class="checkbox"  onclick="doCheck(this.checked);" >&nbsp;&nbsp;&nbsp;&nbsp;
		            <span><a href="javascript:void(0)"  onclick="doCheck(true);">全选</a></span>&nbsp;&nbsp;&nbsp;&nbsp;
		            <span><a href="javascript:void(0)"  onclick="status_multi();">显示所选</a></span>&nbsp;&nbsp;&nbsp;&nbsp;
		            <span><a href="javascript:void(0)"  onclick="del_multi();">删除所选</a></span>&nbsp;&nbsp;&nbsp;&nbsp;
            </div>
              <div class="paginator">
                <span class='pager'><span class="total">共0页</span> <span class="pages"></span></span>            </div>
        </div>
    </div>
</div>
</div>
		<script type="text/javascript" src="/static/other/.com/msg_count"></script>
	<script type="text/javascript">
	$('body').click(function(e){
	if(!$(e.target).hasClass('pub_subLink') && !$(e.target).parents().hasClass('pub_dropmenu')){
	$('.pub_dropmenu').slideUp('fast');
	}
	})
	</script>
	<!--main end--><!--
	{/block}